<template>
  <div id="layer-content">
    <el-container>
      <el-main>
        <el-form :model="form" ref="form" label-width="80px">
          <el-row>
            <el-col :span="12">
              <el-form-item label="昵称" prop="name">
                <el-input v-model="form.name" :readonly="true"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="账号" prop="account">
                <el-input v-model="form.account" :readonly="true"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="密码" prop="password">
                <el-input v-model="form.password" :readonly="true"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </el-main>
      <el-footer>
        <el-row id="layer-footerBtn">
          <el-button type="primary" @click="cancel('form')">取消</el-button>
        </el-row>
      </el-footer>
    </el-container>
  </div>
</template>

<script>
import frameworkUtil from '@/framework/js/frameworkUtil.js'
export default {
  props: {
    layerid: {
      type: String
    },
    _id: {
      type: Number,
      required: true
    }
  },
  data () {
    return {
      form: {
        id: this._id,
        name: '',
        account: '',
        password: ''
      }
    }
  },
  methods: {
    cancel (formName) {
      this.$layer.close(this.layerid);
    }
  },
  created () {
    this.$http.get('http://rap2.taobao.org:38080/app/mock/257330/user/get', { params: { id: this._id } }).then(res => {
      frameworkUtil.JSON.copyProperty(this.form, res.data);
    })
  }
}

</script>
<style rel="stylesheet/scss" lang="scss">
</style>
